package com.hxkj.dao.impl;

import com.hxkj.dao.ResourcesDao;
import com.hxkj.mapper.ResourcesMapper;
import com.hxkj.domain.po.Resources;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: chenwei
* @version: 1.0
* @datetime: 2018-06-09 11:48:18
*
*/
@Service("resourcesDao")
public class ResourcesDaoImpl implements ResourcesDao {

    @Resource
    private ResourcesMapper resourcesMapper;

    @Override
    public Resources get(Long resourcesId) {
        return resourcesMapper.selectByPrimaryKey(resourcesId);
    }

    @Override
    public List<Resources> get(Resources resources) {
        return resourcesMapper.select(resources);
    }

    @Override
    public int delete(Long resourcesId) {
        return resourcesMapper.deleteByPrimaryKey(resourcesId);
    }

    @Override
    public int delete(Resources resources) {
        return resourcesMapper.delete(resources);
    }

    @Override
    public int save(Resources resources) {
        return resourcesMapper.insert(resources);
    }

    @Override
    public int update(Resources resources) {
        return resourcesMapper.update(resources);
    }

    @Override
    public int selectResourcesName(Resources resources) {
        return resourcesMapper.selectResourcesName(resources);
    }

    @Override
    public Resources selectResourcesFolderPath(Resources resources) {
        return resourcesMapper.selectResourcesFolderPath(resources);
    }

    @Override
    public int selectResourcesFolder(Resources resources) {
        return resourcesMapper.selectResourcesFolder(resources);
    }

    @Override
    public List<Resources> getResourcesTree(Resources resources) {
        return resourcesMapper.getResourcesTree(resources);
    }

    @Override
    public List<Resources> selectContainPathFolder(Resources resources) {
        return resourcesMapper.selectContainPathFolder(resources);
    }

    @Override
    public int selectChildResources(Resources resources) {
        return resourcesMapper.selectChildResources(resources);
    }
}
